<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>库存列表</title>
    <link href="<%=path%>/css/core.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/pagination.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/list.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/xToolbar.css" rel="stylesheet" type="text/css"/>
    <link href="<%=path%>/css/jquery-impromptu.css" rel="stylesheet" type="text/css"/>
  </head>
  <body>
    <div id="toolbar"></div>
    <form id="listForm" action="<%=path%>/product/stock/listPagination.t4m" method="post">
      <table id="titleTable" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td><input type="checkbox" id="allBox"/></td>
          <td>采购单号</td>
          <td>采购时间</td>
          <td>货品编号</td>
          <td>货品名称</td>
          <td>货品类别</td>
          <td>规格型号</td>
          <td>生产商</td>
          <td>供应商</td>
          <td>所在仓库</td>
          <td>库存总量</td>
          <td>退货数量</td>
          <td>报警数量</td>
        </tr>
      </table>
      <table id="dataTable" cellpadding="0" cellspacing="0">
        <s:iterator id="object" value="page.list" status="i">
          <tr class="row">
            <td class="num"><s:property value="#i.index+1"/></td>
            <td class="box">
              <input type="checkbox" name="idList" value="<s:property value="#object.id"/>"/>
            </td>
            <td><span><s:property value="#object.inOrder.arriveOrder.purchaseOrder.code"/></span></td>
            <td><span><s:date name="#object.inOrder.arriveOrder.purchaseOrder.orderDate" format="yyyy-MM-dd"/></span></td>
            <td><span><s:property value="#object.product.code"/></span></td>
            <td><span><s:property value="#object.product.name"/></span></td>
            <td><span><s:property value="#object.product.productType.name"/></span></td>
            <td><span><s:property value="#object.product.standard"/></span></td>
            <td><span><s:property value="#object.product.manufacturer"/></span></td>
            <td><span><s:property value="#object.inOrder.arriveOrder.purchaseOrder.supplier.name"/></span></td>
            <td><span><s:property value="#object.warehouse.name"/>&nbsp;</span></td>
            <td><span><s:property value="#object.amounts"/>&nbsp;</span></td>
            <td><span><s:property value="#object.backAmounts"/>&nbsp;</span></td>
            <td><span class="form-required"><s:property value="#object.warnning"/>&nbsp;</span></td>
          </tr>
        </s:iterator>
      </table>
      <s:include value="/share/pagebar.jsp"/>
    </form>
    
    <script src="<%=path%>/js/core.js" type="text/javascript"></script>
    <script src="<%=path%>/js/share.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
    <script src="<%=path%>/js/Grid.js" type="text/javascript"></script>
    <script src="<%=path%>/js/BoxSelect.js" type="text/javascript"></script>
    <script src="<%=path%>/js/xToolbar.js" type="text/javascript"></script>
    <script src="<%=path%>/js/xToolbar.items.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery-impromptu.js" type="text/javascript"></script>
    <script src="<%=path%>/js/modules/stock.js" type="text/javascript"></script>
    <script src="<%=path%>/js/modules/product/product.js" type="text/javascript"></script>
    <script type="text/javascript">
    
    $(document).ready(function(){
    
      var toolbar = new Toolbar({
        id: '1',
        renderTo : 'toolbar',
        icon: '../../image/op.gif',
        items : [{
            type:'button',
            text:'刷新',
            position: {
              a: '-60px 0px',
              b: '-60px -120px'
            },
            handler:function(){
              $('#listForm').submit();
            }
          }]
      });
      
      new Grid({
        titleTable:'titleTable',
        dataTable:'dataTable',
        widths : [30,24,120,100,120,120,120,100,100,100,100,60,60,60],
        height : function(){return getGridHeight({toolbarId:'toolbar',hasPage:true});}
      });

      new BoxSelect({
        allId : 'allBox',
        boxName : 'idList'
      });
      
      loadReady();
    });
    </script>
  </body>
</html>